#ifndef __PID_H__
#define __PID_H__

#include <main.h>

typedef struct
{
	float Kp;
	float Ki;
	float Kd;
	float f;
	float error_integral;
	float error_last;
	float error_last_last;
	float integral_limit;
	int mode;
	float output_accumulation;
}pid_TypeDef;

void pid_init(pid_TypeDef* hpid, float Kp, float Ki, float Kd, float f, float integral_limit, int mode);
float pid_calculate(pid_TypeDef* hpid, float error);

#endif